﻿using System;
using System.Collections.Generic;
using System.Text;

namespace OpenGameEngine.Base
{
    public class GameCoreEventArgs
        : EventArgs, IDisposable
    {
        public GameEngine Core { get; protected set; }
        public GameTime Time { get; protected set; }
        private bool _disposed;

        public GameCoreEventArgs(GameEngine core, GameTime time)
        {
            Core = core;
            Time = time;
        }

        public void Dispose()
        {
            Dispose(true);

            GC.SuppressFinalize(this);
        }

        protected virtual void Dispose(bool disposing)
        {
            if (!_disposed)
            {
                if (disposing)
                {
                    Core.Dispose();
                }

                Core = null;
                Time = null;

                _disposed = true;
            }
        }
    }
}
